<?php

class location_model extends CI_Model 
{
    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }
	
	// Get all entries in tbl_location
	function getAllLocations( )
	{
		return $this->db->get('tbl_location');
	}
	
	function getLocation( $location_id )
	{
		$this->db->where('location_id', $location_id);
		return $this->db->get('tbl_location');
	}
	
	// Updates volumes based on Access ID
	function updateLocation( $location_id, $data_array )
	{
		$update_where = array('location_id' => $location_id);
	
		$this->db->update('tbl_location', $data_array, $update_where); 
	}
	
	// Add Location
	function addLocation( $data_array )
	{
		$this->db->insert('tbl_location', $data_array);
	
	}
	
	// Delete Location based on Location ID
	function deleteLocation( $location_id )
	{
		$delete_where = array('location_id' => $location_id );
	
		$this->db->delete('tbl_location', $delete_where );
	}
}

?>